import "reflect-metadata";
import {EventEmitter} from "../node-test";

export interface AliyunIot {

}

// @ts-ignore
export interface Controller extends EventEmitter {
    openGateway(inout: string): Promise<any>;

    onlyOpenRL(index: number): Promise<any>;

    openRL(index: number): Promise<any>;

    openUpInout(inout: string): void;

    closeWaitUpTimeout(inout: string): void;

    openDownInout(inout: string): void;

    onlyCloseRL(index: number): Promise<any>;

    closeDownInout(inout: string): Promise<any>;
}

// @ts-ignore
export interface Led extends EventEmitter {
    send(vehicle: string, weight: number): void;
}

// @ts-ignore
export interface Printer extends EventEmitter {
    print(count: number, str: string, type: string, paper: any): void;
}

// @ts-ignore
export interface Plate extends EventEmitter {
    manualTrigger(isTriger: boolean): void;
}

export interface Player {
    say(text: string, count: number): void;

    say(text: string): void;
}

// @ts-ignore
export interface Rtsp extends EventEmitter {
    saveImg(inout: string, carNum: string, weight: number, time: string): Promise<{}>;
}

export class vlpr {
    rtsp: string
    deviceSerialNumber: string
    direction: string
}

export interface Settings {
    productKey: string
    deviceName: string
    deviceSecret: string
    url: string
    equipmentType: string
    comPath: string
    combaudRate: number
    dvr: vlpr[]
    vehicleEnter: boolean
    notZeroPlate: boolean
    barrierGate: 'no' | 'out' | 'inout'
    platformId: number
    platformName: string
    led1: string
    led2: string
    weightWenTimeout: number
    readyPlateNum: number
    isSayWeight: boolean
    gatewayEnable: boolean
    asyncWeight: boolean
    ignore: boolean
}

export interface PostData {
    uuid: number;
    deviceName: string;
    inout: string;
    vehicleNumber: string;
    weight: number;
    photoList: string[];
    weighAddress: string;
    createTime: string;
    platformId: number;
}

export interface Qr {
}

// @ts-ignore
export interface Weighter extends EventEmitter {
    get weight(): number;

    get wen(): boolean;
}

// @ts-ignore
export interface Container extends EventEmitter {
}

// @ts-ignore
export interface State extends EventEmitter {
    inout: 'in' | 'out';
    wenWeight: number;
    weighRecordId: number;
    container1: string;
    container2: string;

    clear(): void;

    driverRequest(type: string): void;

    getVehicleNumber(): string;

    hasVehicleNumber(): boolean;

    addPlate(vehicleNumber: string, inout: 'in' | 'out', times: number): void;
}

export interface StateInterface {
    readonly name: string;

    init(): void;

    leave(): void;

    plate(vehicleNumber: string, inout: string): void;

    active(R: boolean[]): void;

    weight_data(weight: number, wen: boolean): void;

    driverRequest(type: string): void;

    do_weigh(weight: number, deductionWeight: number): void;
}

export interface ReadyState extends StateInterface {
}

export interface WaitUpState extends StateInterface {

}

export interface WeightState extends StateInterface {

}

export interface WaitDownState extends StateInterface {

}

export interface DownningState extends StateInterface {

}

export interface Stream {
    id: number
    rtsp: string
}